#{extends 'home.html' /}
#{set title: 'Edit User'/}
<script type="text/javascript" src="@{'/public/javascripts/jquery.validate.js'}"></script> 
	<script type="text/javascript" src="@{'/public/javascripts/jquery.validate.min.js'}"></script> 
	<script type="text/javascript" src="@{'/public/javascripts/validation.js'}"></script> 
	
<h1 class="viewTitle">Admin Edit User Profile</h1>
 <div class="viewContent"> 
   <h2>
   Editing User Profile:- 
   </h2>
   
 	#{ifErrors}
	<div class="error">
 <h4>Oops</h4>
   #{errors}
       <li>${error}</li>
   #{/errors}
   </div>
#{/ifErrors}

         #{form @Users.adminDoneEditProfile(user.userName), id:'adminDoneEdit'}
            <div class="formEntry">
			<div class="formLabel">
				<label>Edit Name :-</label>
			</div>
            <input type="text" class="inputText" name="newName" value=${user.name} required="true" ></input>
            <div class="clear"></div>
			</div>
			<div class="formEntry">
			<div class="formLabel">
				<label>Edit Address :-</label>
			</div>
            <input type="text" class="inputText" name="newAddress" value=${user.address} required="true" ></input>
            <div class="clear"></div>
			</div>
			<div class="formEntry">
			<div class="formLabel">
			<label>Edit Gender :-</label>
			</div>
			#{if user.gender.equalsIgnoreCase("male")}
			<input type="radio" name="newGender" value="male" CHECKED /><label> Male</label>
			<input type="radio" name="newGender" value="female" /><label> Female</label>
			#{/if}
			#{else}
			<input type="radio" name="newGender" value="male"/><label> Male</label>
			<input type="radio" name="newGender" value="female" CHECKED/><label> Female</label>
			#{/else}
			<div class="clear"></div>
			</div>
			<div class="formEntry">
			<div class="formLabel">
			    <label for="dateOfBirth">Edit Date of Birth :-</label> 
			</div>
				<input class= "dateOfBirth" type="text" name="newDateOfBirth" value=${user.dateOfBirth} id="dateOfBirth" required = "true" ></input>
				<div class="clear"></div>
			</div>
			<script type="text/javascript" charset="utf-8">
        		$(".dateOfBirth").datepicker({dateFormat:'yy-mm-dd', showAnim:'fadeIn'})
			</script>
			<div class="formEntry">
			<input type="submit" value="submit" id="submit"></input>
			</div>
		#{/form}
 </div>